/*
 * Copyright (C) 2021 Fastjrun, Inc. All Rights Reserved.
 */
package com.fastjrun.share.demo.helper;

import com.fastjrun.share.demo.entity.LogRecord;
import com.fastjrun.share.demo.entity.SysUser;
import com.fastjrun.share.demo.vo.LogRecordVO;
import com.fastjrun.share.demo.vo.UserVO;

public class EntityToVOConverter {
    public static final UserVO convert(SysUser sysUser){
        UserVO userVO = new UserVO();
        userVO .setIsAccountNonExpired(sysUser.getIsAccountNonExpired());
        userVO .setIsCredentialsNonExpired(sysUser.getIsCredentialsNonExpired());
        userVO .setNickName(sysUser.getNickName());
        userVO .setIsEnabled(sysUser.getIsEnabled());
        userVO .setMobile(sysUser.getMobile());
        userVO .setIsAccountNonLocked(sysUser.getIsAccountNonLocked());
        userVO .setId(sysUser.getId());
        userVO .setEmail(sysUser.getEmail());
        userVO .setUsername(sysUser.getUsername());
        return userVO;

    }
    public static final LogRecordVO convert(LogRecord logRecord){
        LogRecordVO logRecordVO = new LogRecordVO();
        logRecordVO .setId(logRecord.getId());
        logRecordVO.setUserId(logRecord.getUserId());
        logRecordVO .setUsername(logRecord.getUsername());
        logRecordVO .setMobile(logRecord.getMobile());
        logRecordVO .setEmail(logRecord.getEmail());
        logRecordVO.setLoginTime(logRecord.getLoginTime());
        logRecordVO.setLoginIp(logRecord.getLoginIp());
        logRecordVO.setUserAgent(logRecord.getUserAgent());
        return logRecordVO;

    }
}
